package com.open.capacity.finance.dto;

import com.open.capacity.utils.StringUtil;
import lombok.Data;

/**
 * 辅助项余额表
 */
@Data
public class FzxyebDto extends KmyebDto implements Comparable {

    public String wldxCode;
    public String xmCode;
    public String bmCode;

    public String ajName;
    public String pjhName;
    public String zphName;
    public String wldxName;
    public String xmName;
    public String bmName;

    private String id;

    public String getKjkm() {
        if (StringUtil.isNotEmpty(kjkmCode)) {
            return kjkmCode + ' ' + kjkmName;
        } else {
            return "";
        }
    }

    public String getAj() {
        if (StringUtil.isNotEmpty(ajName)) {
            return ajName;
        } else {
            return "";
        }
    }

    public String getWldx() {
        if (StringUtil.isNotEmpty(wldxCode)) {
            return wldxName;
        } else {
            return "";
        }
    }

    public String getXm() {
        if (StringUtil.isNotEmpty(xmCode)) {
            return xmName;
        } else {
            return "";
        }
    }

    public String getBm() {
        if (StringUtil.isNotEmpty(bmCode)) {
            return bmName;
        } else {
            return "";
        }
    }

    public String getPjh() {
        if (StringUtil.isNotEmpty(pjhName)) {
            return pjhName;
        } else {
            return "";
        }
    }

    public String getZph() {
        if (StringUtil.isNotEmpty(zphName)) {
            return zphName;
        } else {
            return "";
        }
    }

    public String aj;
    public String pjh;
    public String zph;
    public String wldx;
    public String xm;
    public String bm;

    @Override
    public int compareTo(Object o) {
        FzxyebDto s = (FzxyebDto) o;
        if (StringUtil.isNotEmpty(this.kjkmCode) && StringUtil.isNotEmpty(s.kjkmCode) && this.kjkmCode.compareTo(s.kjkmCode) < 0) {
            return -1;
        } else if (StringUtil.isNotEmpty(this.kjkmCode) && StringUtil.isNotEmpty(s.kjkmCode) && this.kjkmCode.compareTo(s.kjkmCode) > 0) {
            return 1;
        } else if (StringUtil.isNotEmpty(this.ajName) && StringUtil.isNotEmpty(s.ajName) && this.ajName.compareTo(s.ajName) < 0) {
            return -1;
        } else if (StringUtil.isNotEmpty(this.ajName) && StringUtil.isNotEmpty(s.ajName) && this.ajName.compareTo(s.ajName) > 0) {
            return 1;
        } else if (StringUtil.isNotEmpty(this.pjhName) && StringUtil.isNotEmpty(s.pjhName) && this.pjhName.compareTo(s.pjhName) < 0) {
            return -1;
        } else if (StringUtil.isNotEmpty(this.pjhName) && StringUtil.isNotEmpty(s.pjhName) && this.pjhName.compareTo(s.pjhName) > 0) {
            return 1;
        } else {
            return 0;
        }
    }
}
